package rgbos.forum.domain;

import java.util.Vector;

import rgbos.forum.persistance.Persistance;

public class ForumCtrlTopic {
	private Persistance pres_;

	public ForumCtrlTopic(Persistance pers) {
		this.pres_ = pers;
	}
	public synchronized Vector<Topic> getAllTopics (){
		return this.pres_.getTopics();
	}
	public synchronized Topic enterTopic (int topicId){
		return this.pres_.getTopicById(topicId);
	}
	public int saveNewTopic(Topic top) {
		return this.pres_.saveNewTopic(top);

	}
	public void addViewCount(int topicId) {
		this.pres_.addViewCount(topicId);

	}
	public Topic getTopic(int id_) {		
		return this.pres_.getTopicById(id_);
	}
	
	public boolean deleteTopic(int id_) {
		return  this.pres_.deleteTopic(id_);
		
	}
	public void modifyTopic(Topic newTop) {
		this.pres_.modifyTopic(newTop);
	}
	public Topic getTopicByPostId(int id) {
		return this.pres_.getTopicByPost(id);
	}
	public boolean deleteUser(String value) {
		return this.pres_.deleteUser(value);
	}

}
